home *** CD-ROM | disk | FTP | other *** search
- "compoundView.self,v 1.5 1993/07/13 21:47:28 richards Exp"
- "compoundView - parent of all views that have subViews"
-
- traits views _AddSlotsIfAbsent: (| ^ compoundView = () |)
- traits views compoundView _Define: (|
-
- parent** = traits views view.
-
- creating* = (|
- ^ realise: vmgr = (
- resend.realise: vmgr.
- subViews do: [|:s| s realise].
- self).
- |).
-
- destroying* = (|
- ^ basicUnrealise = (
- subViews do: [|:s| s basicUnrealise].
- resend.basicUnrealise.
- self).
- |).
-
- "don't need to destroy subviews, cos all we do is request
- destruction, and clean up on destroyNotify!"
-
- copying* = (|
- ^ copyUnrealised: sv = (|c|
- c: resend.copyUnrealised: sv.
- c subViews: subViews copy. " should be un-necessary. - mcr "
- c subViews: subViews copyMappedBy: [|:s| s copyUnrealised: c].
- c).
- |).
-
- winOps* = (|
- ^ map = (resend.map.
- ifRealised: [subViews do: [|:s| s map]]).
- |).
-
- subViewManagement* = (|
-
- ^ addSubView: v = (addSubView: v IfCyclic: [error: 'cyclic add']).
-
- ^ addSubView: v IfCyclic: b = (
- (isSuperViewStar: v) ifTrue: b.
- v removeFromSuperView.
- subViews add: v.
- v setSuperView: self.
- ifRealised: [v realise].
- mapped ifTrue: [v map].
- self).
-
- ^ removeSubView: v = (
- subViews remove: v.
- v setSuperView: nil.
- v unrealise.
- self).
-
- ^ removeSubViews = (|svl|
- svl: subViews copy.
- svl do: [|:sv| removeSubView: sv].
- self).
-
- "checks if v is in superView closure"
- _ isSuperViewStar: v = ((== v) ||
- [(superView notNil) && [superView isSuperViewStar: v]]).
-
- ^ subViewDo: aBlock = (
- subViews do: aBlock.
- ).
- |).
-
- |)
-
- prototypes views _AddSlotsIfAbsent: (| ^ compoundView = () |)
- prototypes views compoundView _Define: view copy _AddSlots: (|
- parent* = traits compoundView.
-
- "_" subViews <- list copy.
- _ iName <- 'compoundView'.
- |)
-